<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var count = 0;
 for (var i = 1; i <= 10; i++) {
 // 定义变量计算当前数的阶乘
              var jc = 1;
              for (var j = 1; j <= i; j++) {
                  jc *= j;
              }
              console.log(i + "的阶乘是" + jc);
              count += jc;
         }
          console.log("1 ~ 10的阶乘的总和是" + count);

    </script>
</body>
</html>